<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>限时特惠 - 立即抢购</title>
		<style>
			* {
				margin: 0;
				padding: 0;
				box-sizing: border-box;
			}

			body {
				font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
				background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
				min-height: 100vh;
				padding-bottom: 60px;
			}

			.container {
				max-width: 1200px;
				margin: 0 auto;
				padding: 20px;
			}

			/* 顶部倒计时横幅 */
			.countdown-banner {
				background: rgba(255, 255, 255, 0.95);
				border-radius: 10px;
				padding: 15px;
				margin-bottom: 20px;
				box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
				position: sticky;
				top: 0;
				z-index: 100;
			}

			.countdown {
				display: flex;
				justify-content: center;
				align-items: center;
				gap: 10px;
				font-size: 18px;
				font-weight: bold;
			}

			.time-block {
				background: #ff4757;
				color: white;
				padding: 5px 10px;
				border-radius: 5px;
				min-width: 40px;
				text-align: center;
			}

			/* 商品展示区 */
			.product-section {
				background: white;
				border-radius: 15px;
				padding: 20px;
				margin-bottom: 20px;
				box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
			}

			.product-grid {
				display: grid;
				grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
				gap: 20px;
				margin-top: 20px;
			}

			.product-card {
				border: 1px solid #eee;
				border-radius: 10px;
				overflow: hidden;
				transition: transform 0.3s ease;
				cursor: pointer;
			}

			.product-card:hover {
				transform: translateY(-5px);
				box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
			}

			.product-image {
				width: 100%;
				height: 200px;
				object-fit: cover;
			}

			.product-info {
				padding: 15px;
			}

			.price {
				color: #ff4757;
				font-size: 24px;
				font-weight: bold;
			}

			.original-price {
				color: #999;
				text-decoration: line-through;
				font-size: 16px;
			}

			/* 分享奖励弹窗 */
			.share-modal {
				display: none;
				position: fixed;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
				background: white;
				padding: 30px;
				border-radius: 15px;
				box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
				z-index: 1000;
				text-align: center;
			}

			.share-modal.active {
				display: block;
			}

			.modal-overlay {
				display: none;
				position: fixed;
				top: 0;
				left: 0;
				right: 0;
				bottom: 0;
				background: rgba(0, 0, 0, 0.5);
				z-index: 999;
			}

			.modal-overlay.active {
				display: block;
			}

			/* 底部固定购买栏 */
			.bottom-bar {
				position: fixed;
				bottom: 0;
				left: 0;
				right: 0;
				background: white;
				padding: 10px;
				box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
				display: flex;
				justify-content: space-between;
				align-items: center;
				z-index: 100;
			}

			.buy-button {
				background: linear-gradient(135deg, #ff4757, #ff6348);
				color: white;
				border: none;
				padding: 12px 30px;
				border-radius: 25px;
				font-size: 16px;
				font-weight: bold;
				cursor: pointer;
				transition: transform 0.2s;
			}

			.buy-button:hover {
				transform: scale(1.05);
			}

			.share-button {
				background: #4CAF50;
				color: white;
				border: none;
				padding: 12px 30px;
				border-radius: 25px;
				font-size: 16px;
				cursor: pointer;
				transition: transform 0.2s;
			}

			.share-button:hover {
				transform: scale(1.05);
			}

			/* 优惠券区域 */
			.coupon-section {
				background: white;
				border-radius: 15px;
				padding: 20px;
				margin-bottom: 20px;
			}

			.coupon-list {
				display: grid;
				grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
				gap: 15px;
				margin-top: 15px;
			}

			.coupon {
				border: 2px dashed #ff4757;
				border-radius: 10px;
				padding: 15px;
				text-align: center;
				cursor: pointer;
				transition: all 0.3s;
			}

			.coupon:hover {
				background: #fff5f5;
				transform: scale(1.05);
			}

			/* 社交证明区域 */
			.social-proof {
				background: white;
				border-radius: 15px;
				padding: 20px;
				margin-bottom: 20px;
			}

			.user-activity {
				display: flex;
				align-items: center;
				margin: 10px 0;
				padding: 10px;
				background: #f8f9fa;
				border-radius: 5px;
			}

			.user-avatar {
				width: 40px;
				height: 40px;
				border-radius: 50%;
				margin-right: 10px;
			}
		</style>
	</head>
	<body>
		<div class="container">
			<!-- 倒计时横幅 -->
			<div class="countdown-banner">
				<div class="countdown">
					<span>限时特惠还剩：</span>
					<span class="time-block" id="hours">00</span>
					<span>时</span>
					<span class="time-block" id="minutes">00</span>
					<span>分</span>
					<span class="time-block" id="seconds">00</span>
					<span>秒</span>
				</div>
			</div>

			<!-- 优惠券区域 -->
			<div class="coupon-section">
				<h2>限时优惠券</h2>
				<div class="coupon-list">
					<div class="coupon" onclick="claimCoupon('NEW50')">
						<h3>新人专享</h3>
						<p>满100减50</p>
					</div>
					<div class="coupon" onclick="claimCoupon('SHARE30')">
						<h3>分享有礼</h3>
						<p>满200减30</p>
					</div>
					<div class="coupon" onclick="claimCoupon('GROUP20')">
						<h3>拼团优惠</h3>
						<p>满300减20</p>
					</div>
				</div>
			</div>

			<!-- 商品展示区 -->
			<div class="product-section">
				<h2>热销商品</h2>
				<div class="product-grid">
					<div class="product-card" onclick="showProductDetail(1)">
						<img src="product1.jpg" alt="商品1" class="product-image">
						<div class="product-info">
							<h3>精选商品1</h3>
							<p class="price">¥99</p>
							<p class="original-price">¥199</p>
						</div>
					</div>
					<!-- 更多商品卡片 -->
				</div>
			</div>

			<!-- 社交证明区域 -->
			<div class="social-proof">
				<h2>实时动态</h2>
				<div id="activityList"></div>
			</div>
		</div>

		<!-- 分享弹窗 -->
		<div class="modal-overlay" onclick="closeShareModal()"></div>
		<div class="share-modal">
			<h2>分享得优惠</h2>
			<p>分享给好友，双方均可获得优惠券！</p>
			<button class="share-button" onclick="shareToWeChat()">微信分享</button>
			<button class="share-button" onclick="shareToFriends()">朋友圈分享</button>
		</div>

		<!-- 底部固定购买栏 -->
		<div class="bottom-bar">
			<div>
				<span>已选商品：</span>
				<span id="totalPrice">¥0</span>
			</div>
			<div>
				<button class="share-button" onclick="showShareModal()">分享得优惠</button>
				<button class="buy-button" onclick="checkout()">立即购买</button>
			</div>
		</div>

		<script>
			// 倒计时功能
			function updateCountdown() {
				const endTime = new Date().getTime() + 24 * 60 * 60 * 1000; // 24小时后
				const now = new Date().getTime();
				const distance = endTime - now;

				const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
				const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
				const seconds = Math.floor((distance % (1000 * 60)) / 1000);

				document.getElementById('hours').innerText = hours.toString().padStart(2, '0');
				document.getElementById('minutes').innerText = minutes.toString().padStart(2, '0');
				document.getElementById('seconds').innerText = seconds.toString().padStart(2, '0');
			}

			setInterval(updateCountdown, 1000);

			// 分享功能
			function showShareModal() {
				document.querySelector('.share-modal').classList.add('active');
				document.querySelector('.modal-overlay').classList.add('active');
			}

			function closeShareModal() {
				document.querySelector('.share-modal').classList.remove('active');
				document.querySelector('.modal-overlay').classList.remove('active');
			}

			function shareToWeChat() {
				// 实现微信分享逻辑
				alert('已复制链接，请在微信中打开分享');
			}

			function shareToFriends() {
				// 实现朋友圈分享逻辑
				alert('已复制链接，请在朋友圈中分享');
			}

			// 优惠券领取
			function claimCoupon(code) {
				alert(`优惠券 ${code} 已领取！`);
			}

			// 购买功能
			function checkout() {
				// 实现购买逻辑
				alert('正在跳转到支付页面...');
			}

			// 社交证明动态更新
			function updateSocialProof() {
				const activities = [{
						name: '小明',
						action: '刚刚购买了商品1'
					},
					{
						name: '小红',
						action: '分享了链接给3个好友'
					},
					{
						name: '小张',
						action: '领取了新人优惠券'
					}
				];

				const activityList = document.getElementById('activityList');
				const randomActivity = activities[Math.floor(Math.random() * activities.length)];

				const activityDiv = document.createElement('div');
				activityDiv.className = 'user-activity';
				activityDiv.innerHTML = `
                <img src="avatar.jpg" alt="用户头像" class="user-avatar">
                <span>${randomActivity.name} ${randomActivity.action}</span>
            `;

				activityList.insertBefore(activityDiv, activityList.firstChild);

				// 保持最多显示5条动态
				while (activityList.children.length > 5) {
					activityList.removeChild(activityList.lastChild);
				}
			}

			// 每3秒更新一次社交证明
			setInterval(updateSocialProof, 3000);

			// 初始化
			updateCountdown();
			updateSocialProof();
		</script>
	</body>
</html>